﻿@using PayrollExpress.Helpers;
@using PayrollExpress.Models;
@model WorkLocationListModel

@Html.Partial("_BreadCrumb", Model.BreadCrumb)

<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-9">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    @Html.ActionLink(BaseHelper.PageAction.Add.ToString(), BaseHelper.PageAddEditSave.WorkLocationAddEdit.ToString(), Model.ControllerName, null, new { @class = "btn btn-primary" })
                </div>
                <div class="ibox-content">
                    <table class="table table-striped table-bordered table-hover table-List">
                        <thead class="header">
                            <tr>
                                <th>@AdministrationHelper.ListHeaders.WorkLocationName.ToDescription()</th>
                                <th>@AdministrationHelper.ListHeaders.Address.ToDescription()</th>
                                <th>@AdministrationHelper.ListHeaders.ContactNumbers.ToDescription()</th>
                                <th>@AdministrationHelper.ListHeaders.IsActive.ToDescription()</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            @for (var i = 0; i < Model.ListItems.Count(); i++)
                            {
                                <tr>
                                    <td>@Html.DisplayFor(m => Model.ListItems[i].WorkLocationName)</td>
                                    <td>@Html.DisplayFor(m => Model.ListItems[i].Address)</td>
                                    <td>@Html.DisplayFor(m => Model.ListItems[i].ContactNumbers)</td>
                                    <td>@Html.DisplayFor(m => Model.ListItems[i].IsActiveYesNo)</td>
                                    <td>@Html.ActionLink(BaseHelper.PageAction.Edit.ToDescription(), BaseHelper.PageAddEditSave.WorkLocationAddEdit.ToString(), Model.ControllerName, null, null, null, new { id = Model.ListItems[i].ID }, new { @class = "btn btn-primary btn-sm" })</td>
                                </tr>
                            }
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

@section Styles {
    @Styles.Render("~/Content/plugins/dataTables/dataTablesStyles")
}

@section Scripts {
    @Scripts.Render("~/plugins/dataTables")

    <script type="text/javascript">
        $(document).ready(function () {
            $('.table-List').dataTable();
        });
    </script>
}